<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新品有戏商家合作平台</title>
    <script src="__JS__/jquery.js"></script>
    <link href="__CSS__/boot.css" rel="stylesheet">
    <link href="__STATIC__/layui/css/layui.css" rel="stylesheet">
    <script src="__JS__/layer/layer.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <style>
        tr td{
            text-align: center;
        }
    </style>
</head>
<body>
{include file="base/header" /}
<div style="float: right; margin-top: 5px;margin-bottom: 5px" class="box-title ">
    <form class="form-inline" action="{:url('business/apply/index')}" method="get">
        <div class="layui-inline"> <!-- 注意：这一层元素并不是必须的 -->
            <input type="text" class="layui-input" placeholder="发起时间" id="date" value="<?php if(isset($date)) echo $date ?>" name="date">
        </div>
        <input type="submit" class="btn btn-default" value="搜索"/>
        <input type="button" onclick="res()" value="全部显示" class="btn btn-default"/>
    </form>
</div>
<table class="layui-table">
    <thead>
    <tr>
        <td>申请人</td>
        <td>申请时间</td>
        <td>操作</td>
    </tr>
    </thead>
    <tbody>
    {foreach $result as $val}
        <tr>
            <td>{$Think.session.business.name}</td>
            <td>{$val.date|conversion=###}</td>
            <td>
                <button type="button" onclick="detail({$val.date})" class="btn btn-info btn-xs">详情</button>
            </td>
        </tr>
    {/foreach}
    </tbody>
</table>
</body>
<script>
    //详情
    function detail(date) {
        window.location.href = "{:url('business/apply/detail')}?date="+date;
    }
    //全部显示
    function res() {
        window.location.href = "{:url('business/apply/index')}";
    }


    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#date' //指定元素
        });
    });
</script>
</html>